<{capture name="header"}>
   <!--JAVASCRIPTS SRC-->     
         <{if defined('DEBUG_JS') && DEBUG_JS}>
                <!--src tools-->
                <script type="text/javascript" src="js_src/moo.js"></script>
                <script type="text/javascript" src="js_src/moomore.js"></script>
                <script type="text/javascript" src="js_src/mooadapter.js"></script>
                <script type="text/javascript" src="js_src/jstools.js"></script>
                <script type="text/javascript" src="js_src/coms/dropmenu.js"></script>
                <script type="text/javascript" src="js_src/coms/messagebox.js"></script>
                <script type="text/javascript" src="js_src/coms/datapicker.js"></script>
                <script type="text/javascript" src="js_src/coms/colorpicker.js"></script>
                <script type="text/javascript" src="js_src/coms/validator.js"></script>
                <script type="text/javascript" src="js_src/coms/dialog.js"></script>
                <script type="text/javascript" src="js_src/coms/areaselect.js"></script>
                <script type="text/javascript" src="js_src/coms/editor.js"></script>
                <script type="text/javascript" src="js_src/coms/editor_style_1.js"></script>    
        <{elseif defined('GZIP_JS') && GZIP_JS }>
            <script type="text/javascript" src="js/package/tools.jgz"></script>
            <script type="text/javascript" src="js/package/component.jgz"></script>
        <{else}>
            <script type="text/javascript" src="js/package/tools.js"></script>
            <script type="text/javascript" src="js/package/component.js"></script>
        <{/if}>
    <!--JAVASCRIPTS SRC END-->
    <{if $order.is_has_remote_pdts=='true'}>
         <{if defined('DEBUG_CSS') && DEBUG_CSS}>
            <link rel="stylesheet" href="css_src/purchase.css" type="text/css" media="screen, projection"/>
        <{else}>
            <link rel="stylesheet" href="css/purchase.css" type="text/css" media="screen, projection"/>
        <{/if}>
    <{/if}>
    <style>
       /*fix IMG SRC bug*/
       
       #payment td img,#shipping td img{display:none!important;}
    </style>
<{/capture}>
<{capture name="title"}>
<h1><{img src="images/bundle/spage_editing.gif"}><strong><{t}>正在编辑:<{/t}></strong><{t}><{if $order}>订单号 - <{/t}><{$order.order_id}><{else}>新建订单<{/t}><{/if}></h1>
<ul class="btn-bar">
	<li><{button label="退出编辑" class="btn-quit" onclick="if(confirm('确定退出?'))window.close()"}></li>
	<li><{button label="保　存" type="button" dropmenu="drop-save" class="btn-save" onclick='subOrderForm()' }></li>
</ul>
<ul id="drop-save" class="x-drop-menu">
	<li onclick='subOrderForm(1)'><span class="info" title="设为默认"><{img src="images/bundle/savesetdef.gif" alt="设为默认"}></span><span><{img src="images/bundle/savetolist.gif"}><{t}>并返回列表<{/t}></span></li>
</ul>
<{/capture}>

<div class="spage-main-box">
    <{if $order}>
        <{if $order.is_has_remote_pdts!=='true'}>
            <{include file=$order_edit_path}>
        <{elseif $order.is_has_remote_pdts=='true'}>
        
            <{include file=$edit_po_path}> 
            
        <{/if}>   
	<{else}>   
        <{include file=$order_new_path}> 
    <{/if}>   
</div>
<script>
(function(){
	var tmp_target;
	subOrderForm=function(sign){
		if(document.getElements('form')){var _form=document.getElements('form').getLast();}			
		if(_form&&_form.target.length==0){
				tmp_target=_form;
				tmp_target.target="{update:'messageBox'}";
		}
		if(sign){
			window.MessageBoxOnShow=function(box,success){
				if(MODALPANEL)MODALPANEL.hide();
				if(!success){
					if(tmp_target)tmp_target.target=''
					return
				}
				window.close();
			}
		}else{
			if(tmp_target)tmp_target.target='';
		}			
		_form.fireEvent('submit');		
	};
})();
</script>
 
<{capture name='footbar'}>
<table cellspacing="5" cellpadding="0" style="margin:0 auto; height:50px; width:auto;" class="tableAction">
      <tbody><tr valign="middle">
        <td>
          <b class="submitBtn">
            <button onclick="subOrderForm(1);">
            <span class="iconbutton savetolist">保存并关闭窗口</span>
            </button>
          </b>

			<b class="submitBtn blue">
            <button onclick="subOrderForm()">
            <span class="iconbutton savebutton">保存当前</span>
            </button>
          </b>

         <b isclosedialogbtn="true" class="submitBtn blue">
            <button onclick="if(confirm('确定退出?'))window.close()">
            <span>关闭</span>
            </button>
          </b>
        </td>
        </tr>
        </tbody></table>
<{/capture}>
